<template>
    <div>
      <div class="instructions">
        <div>说明： 目前支持学科和关键字条件筛选</div>
        <el-button type="success"><i class="el-icon-edit"></i>新增试题</el-button>
      </div>
      <el-form :model="questionFromData">
        <el-row>
          <el-col span="6">
            <el-form-item label="学科" label-width="100px">
              <el-select v-model="questionFromData.subject" placeholder="请选择" @change="onChangeSubject"  style="width:140%">
                <el-option v-for="(subject, i) in subjectList.data" :key="i" :label="subject.label" :value="subject.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="二级目录" label-width="100px">
              <el-select v-model="questionFromData.simple" collapse-tags style="width:140%" placeholder="请选择">
                <el-option v-for="(simple, i) in simpleList.data" :key="i" :label="simple.label" :value="simple.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="标签" label-width="100px">
              <el-select v-model="questionFromData.tags" collapse-tags style="width:140%" placeholder="请选择">
                <el-option v-for="(tag, i) in tagList.data" :key="i" :label="tag.label" :value="tag.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="关键字" label-width="100px">
               <el-input v-model="questionFromData.shortName" style="width:150%" placeholder="根据题干搜索"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col span="6">
            <el-form-item label="试题类型" label-width="100px">
              <el-select v-model="questionFromData.questionType" placeholder="请选择" @change="companyCity" style="width:140%">
                <el-option v-for="(questionType, i) in questionTypes" :key="i" :label="questionType.name" :value="questionType.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="难度" label-width="100px">
              <el-select v-model="questionFromData.difficulty" collapse-tags style="width:140%" placeholder="请选择">
                <el-option v-for="(difficulty, i) in difficultys" :key="i" :label="difficulty.name" :value="difficulty.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="方向" label-width="100px">
              <el-select v-model="questionFromData.direction" collapse-tags style="width:140%" placeholder="请选择">
                <el-option v-for="(direction, i) in directions" :key="i" :label="direction" :value="direction" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="录入人" label-width="100px">
              <el-select v-model="questionFromData.city" collapse-tags style="width:140%" placeholder="请选择">
                <el-option v-for="(item, i) in creator" :key="i" :label="item" :value="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col span="6">
            <el-form-item label="题目备注" label-width="100px" >
              <el-input v-model="questionFromData.shortName" style="width:150%" />
            </el-form-item>
          </el-col>
          <el-col span="6">
            <el-form-item label="企业简称" label-width="100px">
              <el-input v-model="questionFromData.shortName" style="width:150%" />
            </el-form-item>
            </el-col>
          <el-col span="6">
            <el-form-item label="城市" label-width="100px">
              <el-select v-model="questionFromData.province" placeholder="请选择" @change="companyCity" style="width:47%">
                <el-option v-for="(province, i) in provinces" :key="i" :label="province" :value="province" />
              </el-select>
              <el-select v-model="questionFromData.city" collapse-tags style="margin-left:8px; width:47% " placeholder="请选择">
                <el-option v-for="(city, i) in companyCitys" :key="i" :label="city" :value="city" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item class="btn"  label-width="250px">
              <el-button @click="clearStatus">清除</el-button>
              <el-button type="primary" @click="onSearch">搜索</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
</template>
<script>
export default {
  name: 'MyTable',
  props: {
    questionFromData: {
      type: Object,
      default: () => ({
        addData: '', //录入时间
        catalog: '', // 目录
        city: '',
        creator: '', // 录入人
        difficulty: '', // 难度
        subject: '', // 学科
        simple: '',
        number: '',// 试题编号
        question: '', // 题干
        questionType: '', // 题型
        tags: '', // 标签
        direction: '', // 方向
        province: '',
      })
    },
    // 表格配置
    tableProps: {
      type: Object,
      default: ()=> ({
        data: []
      })
    },
    pagination: {
      type: Boolean,
      default: true
    },

    paginationEvents: {
      type: Object,
      default: () => ({})
    }
  }
}
</script>
